home *** CD-ROM | disk | FTP | other *** search
- Path: Inter.NL.net!usenet
- From: Auke.Reitsma@net.HCC.nl (Auke Reitsma)
- Newsgroups: comp.lang.c
- Subject: Re: dlist; *not* homework!
- Date: Fri, 01 Mar 1996 23:22:21 GMT
- Organization: Inter.NL.net, The Internet Provider in The Netherlands.
- Message-ID: <4h8144$ruh@altrade.nijmegen.inter.nl.net>
- References: <4h2n2mINN2sm@CS.UTK.EDU>
- Reply-To: Auke.Reitsma@net.HCC.nl
- NNTP-Posting-Host: rt99-19.rotterdam.nl.net
- X-Newsreader: Forte Free Agent 1.0.82
-
- doolin@menkar.cs.utk.edu (David Doolin) wrote:
-
- [...]
- > I need to take two sorted double linked lists, and merge
- > them into one sorted list. I have at my
- > disposal: Usenet, the Cfaq, working dlist code (part of which
- > I wrote, part of which I have linked in). What I don't have
- > is an algorithm.
-
- Basic algorithm:
-
- - Retrieve the next data item from list 1
- - while that data item is 'larger' than the 'current' item in list 2
- make the item following the current item the current item
- (as code: current = current->next; )
- - Insert the data item before the current item.
-
- > ps. Consider it a work of charity: increasing the use and literacy
- > of C in the Civil Engineering community!
-
- Which is what this group is all about anyway ... ;-)
-
-
- Greetings from Delft, The Netherlands.
-
- Auke Reitsma
-
-